package day5;

import java.util.Scanner;

public class Demo5 {
    public static void main(String[] args) {
        //输入年份与月份
        System.out.println("请输入一个年份与月份");
        Scanner sc  = new Scanner(System.in);
        int year = sc.nextInt();
        int month = sc.nextInt();
        //判断该月份的天数
        int[] days ={31,28,31,30,31,30,31,31,30,31,30,31};
        if(((year%4==0)&&(year%100!=0))||(year%400==0)){
            days[month-1]=29;
        }
        //输出结果
        System.out.println("该月的天数为："+days[month-1]);
    }
}
